package com.note.service.impl;

import com.note.dao.UserMapper;
import com.note.entity.User;
import com.note.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by XQ on 2017/6/3.
 */
@Service("User")
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public void register(User user) {
        userMapper.insert(user);
    }

    @Override
    public User isExistUser(String userAccount) {
        return userMapper.isExistAccountByUserAccount(userAccount);
    }

    @Override
    public User findUserByUserAccount(String userAccount) {
        return userMapper.findUserByUserAccount(userAccount);
    }

    @Override
    public User findUserIdByUserAccount(String userAccount) {
        return userMapper.findUserIdByUserAccount(userAccount);
    }

    @Override
    public User findUserInfoByUserAccount(String userAccount) {
        return userMapper.findUserInfoByUserAccount(userAccount);
    }

}
